package park.model.party;

import java.io.Serializable;
import java.sql.Date;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
/**
 * @archetype party-place-thing
 * @author gilberto
 * @since 08/04/2009
 */
public class PessoaJuridica extends Pessoa implements Serializable {
	private static final long serialVersionUID = 1L;
	private Date dtFundacao;
	private String cnpj;
	
	public PessoaJuridica(){};
	public PessoaJuridica(Integer cdPessoa, String nome, String tipo, String endereco, Date dtFundacao, String cnpj) {
		super(cdPessoa, nome, tipo, endereco);
		this.dtFundacao = dtFundacao;
		this.cnpj = cnpj;
	}
	public Date getDtFundacao() {return dtFundacao;}
	public void setDtFundacao(Date dtFundacao) {this.dtFundacao = dtFundacao;	}
	public String getCnpj() {return cnpj;}
	public void setCnpj(String cnpj) {this.cnpj = cnpj;}
	public boolean equals(final Object other) {
		if (this == other)
			return true;
		if (!(other instanceof PessoaJuridica))
			return false;
		PessoaJuridica castOther = (PessoaJuridica) other;
		return new EqualsBuilder()
					.append(dtFundacao, castOther.dtFundacao)
					.append(cnpj, castOther.cnpj).isEquals();
	}
	public int hashCode() {
		return new HashCodeBuilder()
					.append(dtFundacao)
					.append(cnpj).toHashCode();
	}
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
				.appendSuper(super.toString())
				.append("dtFundacao", dtFundacao)
				.append("cnpj", cnpj).toString();
	}

	
}
